package com.kgc.study;

public class Cat extends Pet {
    /**
     * 特有的属性  毛色
     */
    private String color;

    public Cat() {

    }

    public Cat(String name, int health, int love, String color) {
        super(name, health, love);
        this.color = color;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    //重写方法(将父类的方法重新实现)
    @Override
    public void print() {
        System.out.println("猫咪说:");
        System.out.println("我的名字叫" + this.getName() + ",我的健康的值：" + this.getHealth() + ",我和主人亲密度是:" + this.getLove() + "，我的毛色是:" + this.getColor());
    }

    @Override
    public void toHospital() {
         if(this.getHealth() <  50){
             System.out.println(this.getName() + "生病了，正在宠物医看病中...");
             System.out.println("治疗方法是：打针、输液 ...");
             this.setHealth(65);
             System.out.println("正在恢复中，健康值增加了" + this.getHealth());
         }
    }
}
